import { ElNotification, ElMessageBox } from 'element-plus'
import nprogress from 'nprogress'

export function toast(message, type="success") {
    ElNotification({
        message: message,
        type: type,
      })
}

export function toastWarn(message, type="warning") {
  ElNotification({
      message: message,
      type: type,
    })
}

export function toastError(message, type="error") {
  ElNotification({
      message: message,
      type: type,
    })
}

// 消息提示
export function showModal(content="提示内容", type="warning", title="") {
  return ElMessageBox.confirm(
    content,
    title,
    {
      confirmButtonText: '确认',
      cancelButtonText: '取消',
      type: type,
    }
  )
}

// 显示全屏loading
export function showFullLoading() {
  nprogress.start()
}

//隐藏全屏loading
export function hideFullLoading() {
  nprogress.done()
}